import 'package:get/get.dart';

///
///Author: YYF
///Date: 2022-02-06 16:45:11
///Description:
///

class ConfigStore extends GetxController {
  static ConfigStore get to => Get.find();

  bool isFirstOpen = false;
  // PackageInfo? _platform;
  // String get version => _platform?.version ?? '-';
  // bool get isRelease => const bool.fromEnvironment("dart.vm.product");
  // Locale locale = const Locale('zh', 'CN');
  // List<Locale> languages = const [
  //   Locale('en', 'US'),
  //   Locale('zh', 'CN'),
  // ];

  // @override
  // void onInit() {
  //   super.onInit();
  //   isFirstOpen = StorageService.to.getBool(STORAGE_DEVICE_FIRST_OPEN_KEY);
  // }

  // Future<void> getPlatform() async {
  //   // _platform = await PackageInfo.fromPlatform();
  // }

  // // 标记用户已打开APP
  // Future<bool> saveAlreadyOpen() {
  //   return StorageService.to.setBool(STORAGE_DEVICE_FIRST_OPEN_KEY, false);
  // }

  // void onInitLocale() {
  //   var langCode = StorageService.to.getString(STORAGE_LANGUAGE_CODE);
  //   if (langCode.isEmpty) return;
  //   var index = languages.indexWhere((element) {
  //     return element.languageCode == langCode;
  //   });
  //   if (index < 0) return;
  //   locale = languages[index];
  // }

  // void onLocaleUpdate(Locale value) {
  //   locale = value;
  //   Get.updateLocale(value);
  //   StorageService.to.setString(STORAGE_LANGUAGE_CODE, value.languageCode);
  // }
}

String demoImg =
    'https://upload-images.jianshu.io/upload_images/1347904-412fc7b86c2d19e5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240';

String placeHolderImg = 'https://via.placeholder.com/1000x1000?text=eGo';

String demoImg2 =
    'https://upload-images.jianshu.io/upload_images/1347904-cd3a4c769c65ee00.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240';

String demoImg3 =
    'https://upload-images.jianshu.io/upload_images/1347904-4e2813d25eeadfbf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240';
String demoImg4 =
    'https://upload-images.jianshu.io/upload_images/1347904-0b7a2296ca3a1d60.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240';
